# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Justin Berthault <justin.berthault@zaclys.net>
pkgname=py3-django-taggit
pkgver=4.0.0
pkgrel=0
pkgdesc="Simple tagging for django"
options="!check" # Testsuite for coverage and flake8
url="https://github.com/jazzband/django-taggit"
arch="noarch"
license="BSD-3-Clause"
depends="py3-django"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-lang $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jazzband/django-taggit/archive/$pkgver.tar.gz"
builddir="$srcdir"/django-taggit-$pkgver

replaces="py-djanog-taggit" # Backwards compatibility
provides="py-djanog-taggit=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

lang() {
	pkgdesc="translations for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel lang"

	amove usr/lib/python3*/site-packages/taggit/locale/
}

sha512sums="
1ea1c2c540c2f9d71e1f4f4fdf82d0f2e234f4fbdb907f67884625bf2e879d384cd3758486a06fc794f33da3c8102317c5bc916de7c6c6886b2f78792adbb8d1  py3-django-taggit-4.0.0.tar.gz
"
